﻿namespace HuaWei
{
    using DevExpress.XtraEditors;
    using HuaWei.CommClass;
    using System;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Windows.Forms;

    public class FrmKHBLJ_BZGSKH : Form
    {
        private string _str = "\r\n说明：保留金每期按工程进度以固定比例xx%分期从各月的进度付款证书中扣回，累计扣回金额达到保留金总额时即不再扣除。";
        private BindingSource bindingSource = null;
        private SimpleButton btnCancel;
        private SimpleButton btnOK;
        private TextEdit edtBLJZE;
        private TextEdit edtKHBL;
        private TextEdit edtQKJE;
        private IContainer icontainer = null;
        private KHBLJ_BZGSKH khblj_BZGSKH = null;
        private LabelControl labelControl1;
        private LabelControl labelControl2;
        private LabelControl labelControl3;
        private LabelControl labelControl4;
        private LabelControl labelControl5;
        private LabelControl labelControl6;

        public FrmKHBLJ_BZGSKH()
        {
            this.InitializeComponent();
        }

        private void btnCancel_Click(object sender, EventArgs e)
        {
            base.DialogResult = System.Windows.Forms.DialogResult.Cancel;
        }

        private void btnOK_Click(object sender, EventArgs e)
        {
            this.khblj_BZGSKH.BLJZE = Convert.ToDecimal(this.edtBLJZE.EditValue);
            this.khblj_BZGSKH.KHBL = Convert.ToDecimal(this.edtKHBL.EditValue);
            this.khblj_BZGSKH.QKJE = Convert.ToDecimal(this.edtQKJE.EditValue);
            DataRow dataRow = DHelp.GetDataRow(this.bindingSource);
            dataRow["KHBLJGS"] = this.khblj_BZGSKH.ToString();
            string format = "保留金总额{0}(元)  扣回比例{1}%   起扣金额{2}(元)" + this._str;
            dataRow["KHBLJLXBZ"] = string.Format(format, this.khblj_BZGSKH.BLJZE, this.khblj_BZGSKH.KHBL, this.khblj_BZGSKH.QKJE);
            dataRow.EndEdit();
            base.DialogResult = System.Windows.Forms.DialogResult.OK;
        }

        protected override void Dispose(bool disposing)
        {
            if (disposing && (this.icontainer != null))
            {
                this.icontainer.Dispose();
            }
            base.Dispose(disposing);
        }

        private void FrmKHBLJ_BZGSKH_Load(object sender, EventArgs e)
        {
        }

        public void IniForm(BindingSource source)
        {
            this.bindingSource = source;
            DataRow dataRow = DHelp.GetDataRow(this.bindingSource);
            this.khblj_BZGSKH = new KHBLJ_BZGSKH(dataRow["KHBLJGS"].ToString());
            this.edtBLJZE.EditValue = this.khblj_BZGSKH.BLJZE;
            this.edtKHBL.EditValue = this.khblj_BZGSKH.KHBL;
            this.edtQKJE.EditValue = this.khblj_BZGSKH.QKJE;
        }

        private void InitializeComponent()
        {
            this.labelControl1 = new LabelControl();
            this.labelControl2 = new LabelControl();
            this.labelControl3 = new LabelControl();
            this.labelControl4 = new LabelControl();
            this.labelControl5 = new LabelControl();
            this.labelControl6 = new LabelControl();
            this.edtBLJZE = new TextEdit();
            this.edtKHBL = new TextEdit();
            this.edtQKJE = new TextEdit();
            this.btnCancel = new SimpleButton();
            this.btnOK = new SimpleButton();
            this.edtBLJZE.Properties.BeginInit();
            this.edtKHBL.Properties.BeginInit();
            this.edtQKJE.Properties.BeginInit();
            base.SuspendLayout();
            this.labelControl1.Location = new Point(0x2a, 0x1d);
            this.labelControl1.Name = "labelControl1";
            this.labelControl1.Size = new Size(60, 14);
            this.labelControl1.TabIndex = 0;
            this.labelControl1.Text = "保留金总额";
            this.labelControl2.Location = new Point(0x36, 0x36);
            this.labelControl2.Name = "labelControl2";
            this.labelControl2.Size = new Size(0x30, 14);
            this.labelControl2.TabIndex = 1;
            this.labelControl2.Text = "扣回比例";
            this.labelControl3.Location = new Point(0x36, 0x4f);
            this.labelControl3.Name = "labelControl3";
            this.labelControl3.Size = new Size(0x30, 14);
            this.labelControl3.TabIndex = 2;
            this.labelControl3.Text = "起扣金额";
            this.labelControl4.Location = new Point(0xd6, 0x1c);
            this.labelControl4.Name = "labelControl4";
            this.labelControl4.Size = new Size(12, 14);
            this.labelControl4.TabIndex = 3;
            this.labelControl4.Text = "元";
            this.labelControl5.Location = new Point(0xd6, 0x4e);
            this.labelControl5.Name = "labelControl5";
            this.labelControl5.Size = new Size(12, 14);
            this.labelControl5.TabIndex = 4;
            this.labelControl5.Text = "元";
            this.labelControl6.Location = new Point(0xd6, 0x35);
            this.labelControl6.Name = "labelControl6";
            this.labelControl6.Size = new Size(12, 14);
            this.labelControl6.TabIndex = 5;
            this.labelControl6.Text = "%";
            this.edtBLJZE.Location = new Point(0x6c, 0x19);
            this.edtBLJZE.Name = "edtBLJZE";
            this.edtBLJZE.Size = new Size(100, 0x15);
            this.edtBLJZE.TabIndex = 6;
            this.edtKHBL.Location = new Point(0x6c, 50);
            this.edtKHBL.Name = "edtKHBL";
            this.edtKHBL.Size = new Size(100, 0x15);
            this.edtKHBL.TabIndex = 7;
            this.edtQKJE.Location = new Point(0x6c, 0x4b);
            this.edtQKJE.Name = "edtQKJE";
            this.edtQKJE.Size = new Size(100, 0x15);
            this.edtQKJE.TabIndex = 8;
            this.btnCancel.Location = new Point(0x99, 0x80);
            this.btnCancel.Name = "btnCancel";
            this.btnCancel.Size = new Size(0x4b, 0x17);
            this.btnCancel.TabIndex = 11;
            this.btnCancel.Text = "取消";
            this.btnCancel.Click += new EventHandler(this.btnCancel_Click);
            this.btnOK.Location = new Point(0x35, 0x80);
            this.btnOK.Name = "btnOK";
            this.btnOK.Size = new Size(0x4b, 0x17);
            this.btnOK.TabIndex = 10;
            this.btnOK.Text = "确定";
            this.btnOK.Click += new EventHandler(this.btnOK_Click);
            base.AutoScaleDimensions = new SizeF(6f, 12f);
            base.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            base.ClientSize = new Size(0x124, 180);
            base.Controls.Add(this.btnCancel);
            base.Controls.Add(this.btnOK);
            base.Controls.Add(this.edtQKJE);
            base.Controls.Add(this.edtKHBL);
            base.Controls.Add(this.edtBLJZE);
            base.Controls.Add(this.labelControl6);
            base.Controls.Add(this.labelControl5);
            base.Controls.Add(this.labelControl4);
            base.Controls.Add(this.labelControl3);
            base.Controls.Add(this.labelControl2);
            base.Controls.Add(this.labelControl1);
            base.Name = "FrmKHBLJ_BZGSKH";
            base.StartPosition = FormStartPosition.CenterParent;
            this.Text = "扣回保留金：标准公式扣回";
            base.Load += new EventHandler(this.FrmKHBLJ_BZGSKH_Load);
            this.edtBLJZE.Properties.EndInit();
            this.edtKHBL.Properties.EndInit();
            this.edtQKJE.Properties.EndInit();
            base.ResumeLayout(false);
            base.PerformLayout();
        }
    }
}

